<table class="table table-bordered">
    <thead>
    <tr>
        <th width="8%">拍卖单号</th>
        <th width="15%">车型</th>
        <th width="6%">所在地</th>
        <?php if($params['status']==0 ||$params['status']==1 || $params['status']==2 ):?>
        <th width="8%">车商联系人</th>
        <th width="10%">联系人电话</th>
        <?php endif;?>
        <th width="8%">拍卖最高价</th>
        <th width="7%">保留价</th>
        <?php if($params['auth'] && $params['status']==3):?>
        <th width="8%">渠道来源</th>
        <?php endif;?>
        <?php if($params['auth'] && $params['status']!=0 && $params['status']!=5):?>
        <th width="6%">操作人</th>
        <?php endif;?>
        <?php if($params['status']==1):?>
        <th width="12%">下次跟踪时间</th>
        <?php elseif($params['status']==3 || $params['status']==5):?>
        <th width="10%">确认时间</th>
        <?php endif;?>
        <th width="6%">确认类型</th>
        <th width="4%">操作</th>
    </tr>
    </thead>
    <tbody>
    <volist name="list" id="list" key="k">
        <tr>
            <td style="text-align: center;">{$list.order_no}</td>
            <td>
                <a href="{:U('Car/report',['car_id'=>$list['car_id']])}" target="_blank"
                   class="cheText">{$list.model}</a>
            </td>
            <td style="text-align: center;">{$list.location_area}</td>
            <?php if($params['status']==0 ||$params['status']==1 || $params['status']==2 ):?>
            <td style="text-align: center;">{$list.dealer_contact_person}</td>
            <if condition="$Think.get.status eq 0">
                <td style="text-align: center;">{$list.dealer_phone_has_star}</td>
                <else/>
                <td style="text-align: center;">{$list.dealer_contact_mobile}</td>
            </if>
            <?php endif;?>
            <td style="text-align: center;">{$list.best_price}元</td>
            <td style="text-align: center;">{$list.reserve_price}元</td>
            <?php if($params['auth'] && $params['status']==3):?>
            <td style="text-align: center;">
                <if condition="$list.comefrom neq ''">
                    <?php if(empty($list['comefrom_url'])):?>
                    <?php echo $show_from[$list['comefrom']];?>
                    <?php else: ?>
                    <a href="{$list.comefrom_url}" target="_blank" rel="noreferrer"><?php echo $show_from[$list['comefrom']];?></a>
                    <?php endif;?>
                    <else/>
                    未知
                </if>
            </td>
            <?php endif;?>
            <?php if($params['auth'] && $params['status']!=0 && $params['status']!=5):?>
            <td style="text-align: center;">{$list.platform_service}</td>
            <?php endif;?>
            <?php if($params['status']==1):?>
            <td style="text-align: center;">{$list.next_trace_time}</td>
            <?php elseif($params['status']==3) :?>
            <td style="text-align: center;">{$list.platform_confirm_time}</td>
            <?php elseif($params['status'] == 5): ?>
            <td>{$list.platform_conform_failed_time}</td>
            <?php endif;?>
            <td>{$list.platform_confirm_type_name}</td>
            <td>
                <if condition="$list[status] eq 5 AND $list[confirm_type] eq 1">
                    <if condition="$Think.get.status eq 0">
                        <a onclick="is_assigned('{$list.order_id}');" href="javascript:;">确认</a>
                        <else/>
                        <if condition="$params['emp_id'] eq $list['platform_confirm_service_id']">
                            <if condition="$params.fenpei_auth eq true">
                                <a href="{:U('AuOrder/platform_confirm_detail',['status'=>$params['status'],'order_id'=>$list['order_id']])}">确认</a>
                                <a href="javascript:;" onclick="fenpei('{$list.order_id}');">分配</a>
                                <else/>
                                <a href="{:U('AuOrder/platform_confirm_detail',['status'=>$params['status'],'order_id'=>$list['order_id']])}">确认</a>
                            </if>
                            <elseif condition="$params.fenpei_auth AND $params['emp_id'] neq $list['platform_confirm_service_id']"/>
                            <a href="javascript:;" onclick="fenpei('{$list.order_id}');">分配</a>
                        </if>
                    </if>
                    <elseif condition="$list[status] egt 7 "/>
                    <a href="{:U('AuOrder/platform_confirm_view',['status'=>$params['status'],'order_id'=>$list['order_id']])}"
                       target="_blank">查看</a>
                </if>
            </td>
        </tr>
    </volist>
    </tbody>
</table>
<div class="error msg" style="color: red; text-align:left;">{$errMsg}</div>
<div class="pageFaye"><div class="pager">{$page}</div><div class="clear"></div></div>

<div class="deparHover" style="height: 200px;">
    <h4>分配客服</h4>
    <label>
        <select name="service_id" id="service_id" style="float: right;width: 360px;">
            <option value="0">请选择客服</option>
            <?php foreach($kfs as $kf):?>
            <option value="{$kf.emp_id}">{$kf.real_name}</option>
            <?php endforeach;?>
        </select>
        分配给：
    </label>
    <div class="deparBtn">
        <input type="button" value="确定" class="deparQue" id="fenpeiQueding">
        <input type="button" value="取消" id="fenpeiQuxiao">
    </div>
</div>

<script type="text/javascript">
    function fenpei(order_id){
        var bg = $(".yunBei");
        var pp = $(".deparHover");
        var qd = $("#fenpeiQueding");
        var qx = $("#fenpeiQuxiao");

        $("#service_id").select2();
        bg.show();
        pp.show();
        $([bg,qd,qx]).each(function(i,n){
            $(n).unbind('click');
        });
        qx.click(hide_pp);
        bg.click(hide_pp);
        qd.click(function(){
            var service_id = $("#service_id").val();
            $.post("/AuOrder/platFormAssignServer",{"order_id":order_id, "service_id":service_id},function(data){
                if(data.code != 200){
                    shibai_alert(data.msg, 1500);
                    return false;
                }
                btn_alert("分配成功",1000,function(){
                    window.location.reload();
                });
            },"json");
        });
        function hide_pp(){
            bg.hide();
            pp.hide();
            bg.unbind('click');
        }
    }
</script>